<?php

class Core_Controller_Admincp_Menu_Item_Index	  extends Nuo_Controller_Admincp
{
	function execute($request)
	{

		Nuo::setVar('breadcrum', array(
			'title' => 'Browse Menu',
			'links' => array(
				'admincp' => 'AdminCP',
				'admincp/appearance' => 'Appearance',
				'admincp/core/menu' => 'Browse Menu',
			),
			'toolbar' => 'admincp/core/menu',
		));

		$id = $request -> getParam('menu_id');

		$table = Nuo::getTable('core/menuitem');

		$select = $table -> select() 
		-> where('menu_id=?', (int)$id) 
		-> order('parent_id') -> order('sort_order');

		$items = $table -> fetchAll($select);

		return  $this -> render(array('items' => $items));
	}

}
